﻿<%@ Page Language="C#" MasterPageFile="~/GUIMaster.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="TripLOA.GUI.WebForm1"  %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server" meta:resourcekey="Page">
    
    <script type="text/javascript" src="master/resourcesNew/animate.js"></script>
    
    <script type="text/javascript">
           var co2;
           var timer_counter;
           
           function init(){
            co2 = init.arguments[0];
           }
           
            function counter(){               
              num = parseFloat((Math.random()* ((0.05) - (0.01) + 1) + (0.01)));           
              co2 = (num + parseFloat(co2)).toFixed(2); 
              document.getElementById('count').innerHTML = co2;
              timer_counter = setTimeout('counter()',2000);
            }
    </script>
    
    <script type="text/javascript">
        
        var tm;
        function prova() {
          
            counter();
              
            var bt_up = document.getElementById('bt_up_def');
            var bt_down = document.getElementById('bt_down_def');
            var info_stat = document.getElementById('info_stats');
            var info_stat = document.getElementById('info_stats');
            
            
            bt_up.style.height= "0px";
            bt_down.style.height= "0px";
            
            
            var lu = document.getElementById('lastTrips');
            lu.style.height = '0px';
	        
	        var cs = document.getElementById('dss');
	        cs.style.height = 'auto';
            
            var de = document.getElementById('description');
            var sl = document.getElementById('slogan');
            
            if (!AnimeIsIE) {
                bt_up.style.opacity= 0.0;
                bt_down.style.opacity= 0.0;
                info_stat.style.opacity = 0.0;
                sl.style.opacity = 0.0;
                info_stat.style.opacity = 0.0;
            }else{
                bt_up.style.filter = 'alpha(opacity=0)';
                bt_down.style.filter = 'alpha(opacity=0)'; 
                sl.style.filter = 'alpha(opacity=0)';
                info_stat.style.filter = 'alpha(opacity=0)';
            }
            
            tm = new Timeline();
      
            tm.SetAt(0, AnimeInterp.alpha(1500, 40, cs.style, 0.0, 1.0));
            tm.SetAt(0, AnimeInterp.alpha(1500, 40, de.style, 0.0, 1.0));
            tm.SetAt(1500, AnimeInterp.alpha(1500, 40, sl.style, 0.0, 1.0));
           
            
            tm.SetAt(6500, AnimeInterp.alpha(1500, 40, cs.style, 1.0, 0.0));
            tm.SetAt(6500, AnimeInterp.alpha(1500, 40, de.style, 1.0, 0.0));
            tm.SetAt(6500, AnimeInterp.alpha(1500, 40, sl.style, 1.0, 0.0));
            
            tm.Run(); 
           
            tm.OnEnd = function () {prova_2();}
          }
          
          function prova_2(){
          
            clearTimeout(timer_counter); 
            
            tm = new Timeline();
            var lu = document.getElementById('lastUserRegistered');
            var cs = document.getElementById('dss');
            var info_stat = document.getElementById('info_stats');
            
            cs.style.height = '0px';
            lu.style.height = 'auto';
            
            if (!AnimeIsIE) {
                info_stat.style.opacity = 0.0;
                lu.style.opacity=0.0;
            }else{
                info_stat.style.filter = 'alpha(opacity=0)';
                lu.style.filter = 'alpha(opacity=0)';
                
            }
            
            tm.SetAt(0, AnimeInterp.alpha(1500, 40, lu.style, 0.0, 1.0));
            tm.SetAt(1000, AnimeInterp.alpha(1500, 40, info_stat.style, 0.0, 1.0));
            
            tm.SetAt(6500, AnimeInterp.alpha(1500, 40, lu.style, 1.0, 0.0));
            tm.SetAt(6500, AnimeInterp.alpha(1500, 40, info_stat.style, 1.0, 0.0));
            tm.Run(); 
            tm.OnEnd = function () {prova_3();}
          }
          
          function prova_3(){
          
          
            var lu = document.getElementById('lastUserRegistered');
            var bt_up = document.getElementById('bt_up_def');
            var bt_down = document.getElementById('bt_down_def'); 
            var info_stat = document.getElementById('info_stats');
            var lt = document.getElementById('lastTrips');
            
            bt_up.style.height= "auto";
            bt_down.style.height= "auto";
            
            lu.style.height = '0px';
          
            tm = new Timeline();
            lt.style.height = 'auto';
            
            
            if (!AnimeIsIE) {
                info_stat.style.opacity = 0.0;
                bt_up.style.opacity = 0.0;
                bt_down.style.opacity = 0.0;
                lt.style.opacity=0.0;
            }else{
                info_stat.style.filter = 'alpha(opacity=0)';
                bt_up.style.filter = 'alpha(opacity=0)'; 
                bt_down.style.filter = 'alpha(opacity=0)';
                lt.style.filter = 'alpha(opacity=0)';
            }
            
            tm.SetAt(0, AnimeInterp.alpha(1500, 40, lt.style, 0.0, 1.0));
            tm.SetAt(500, AnimeInterp.alpha(1500, 40, bt_up.style, 0.0, 1.0));
            tm.SetAt(500, AnimeInterp.alpha(1500, 40, bt_down.style, 0.0, 1.0));
            
            tm.SetAt(6500, AnimeInterp.alpha(1500, 40, lt.style, 1.0, 0.0));
            tm.SetAt(6500, AnimeInterp.alpha(1500, 40, bt_up.style, 1.0, 0.0));
            tm.SetAt(6500, AnimeInterp.alpha(1500, 40, bt_down.style, 1.0, 0.0));
                     
            tm.Run(); 
            tm.OnEnd = function () {prova();}
          }
          
            var timerDown;
            var timerUp; 
            var flag = false;
            
            function up_down(id){
                if(!flag){
                    pause();
                    flag = true;
                }
                    scrollDivDown(id);
                
            }
            
            function up_up(id){
                if(!flag){
                    pause();
                    flag = true;
                }
                scrollDivUp(id);
            }
            
            function scrollDivDown(id){ 
            document.getElementById(id).scrollTop+=4 ; 
            timerDown=setTimeout("scrollDivDown('"+id+"')",30); 

            }  

            function scrollDivUp(id){ 
            document.getElementById(id).scrollTop-=4;  
            timerUp=setTimeout("scrollDivUp('"+id+"')",30);
            }  

            function stopMe(){
            clearTimeout(timerDown);  
            clearTimeout(timerUp); 
            } 
            
            function pause_bt(){
                document.getElementById("content_bt_slide").innerHTML = '';  
                document.getElementById("content_bt_slide").innerHTML = '<img id="current_bt" class="class_bt_play_pause" onclick="javascript:resume();" alt="play" src="master/resourcesNew/img/bt_play.png" />';
            }
            
            function play_bt(){
                flag = false;
                document.getElementById("content_bt_slide").innerHTML = '';  
                document.getElementById("content_bt_slide").innerHTML = '<img id="current_bt" class="class_bt_play_pause" onclick="javascript:pause();" alt="pause" src="master/resourcesNew/img/bt_pause.png" />';
            }
            
            function pause(){
            if(!flag){
                pause_bt();
                flag = true;
                tm.Pause(); 
             } 
            }
            
            function resume(){
                play_bt();
                tm.Resume();  
            }
             
    </script>
    

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentHomePage" runat="server">
    <h1><asp:Label ID="lblDefaultTitle" runat="server"  Text="TripLOA"></asp:Label></h1>

    

<div id="defaultContent_page">       

     <div id="content_windows_header"> 
        <div id ="content_bt_slide">
         <img id="current_bt" class="class_bt_play_pause" onclick="javascript:pause();" alt="pause" src="master/resourcesNew/img/bt_pause.png" />
       
         </div>
     </div>
    <div id="content_windows_line">
         
         <div id="lastUserRegistered">
         <div id="info_stats">
         <div>
            <asp:label ID="users_title" Text="Siamo in" CssClass="label_title" runat="server" meta:resourcekey="stats_user"/>
            
                <asp:label ID="user_val" runat="server" CssClass="lbl_strong_stat_home" />
              
                <br />
                <asp:label ID="trips_title" Text="Totale Viaggi Creati" CssClass="label_title" runat="server" meta:resourcekey="stats_trip"/>
              
                <asp:label ID="trips_val" runat="server" CssClass="lbl_strong_stat_home" />
            </div>
         </div>
        <asp:LinqDataSource ID="LDS_LastRegistered" runat="server" 
            ContextTypeName="TripLOA.GUI.DataSourceRepository" 
            TableName="GetLastUsersRegistered" Select="new (Username, Gender)">
        </asp:LinqDataSource>
        <asp:ListView ID="ListViewLastUserRegistered" runat="server" 
            DataSourceID="LDS_LastRegistered">
        <LayoutTemplate>
           <div id="title_lastUserReg">
                <asp:Label ID="lblLastUsers" runat="server" Text="Ultimi utenti registrati" meta:resourcekey="stats_last_user"></asp:Label>
           </div>
            <asp:PlaceHolder ID="itemPlaceholder" runat="server"></asp:PlaceHolder>
        </LayoutTemplate>
            
        <ItemTemplate>
       
            <div class="content_lastUserReg">
            
          <asp:Image ID="igmUser" runat="server" 
                    
                    
                    
                    ImageUrl='<%# "master/resourcesNew/img/" + Get_Gender(""+Eval("Gender")) + ".png" %>' />
           <%--<asp:Label ID="lblLastUser" runat="server"><%# Eval("Username") %></asp:Label> <br />--%>
           <% if (Page.User.Identity.IsAuthenticated) { %>
           <asp:HyperLink ID="hyperLastRegUser" runat="server" 
                    NavigateUrl='<%# "secure/userProfile.aspx?Nick=" +  Eval("Username") %>'><%# Eval("Username") %></asp:HyperLink>
                <br />
            <%}else{%><asp:HyperLink ID="hyperLastRegUser_1" runat="server" 
                    NavigateUrl='<%# "NotAuthorized.aspx"  %>'><%# Eval("Username") %></asp:HyperLink>
                <br />
            <%}%></div>
        </ItemTemplate>
        
        </asp:ListView>
        
    </div>
    
    <div id="bt_up_def" onmouseover="up_up('list_trip');" onmouseout="stopMe();"></div>
    <div id="bt_down_def" onmouseover="up_down('list_trip');" onmouseout="stopMe();"></div>
    
    
    <div id="lastTrips">
        <div id="title_trip_created">
            <asp:Label ID="lblLastTrips" runat="server" Text="Ultimi Viaggi Inseriti" meta:resourcekey="stats_last_trips"></asp:Label>
            </div>
         <div id="list_trip">
   <asp:LinqDataSource ID="LDS_LastTrips" runat="server" 
            ContextTypeName="TripLOA.GUI.DataSourceRepository" 
            Select="new (OriginCity, DestinationCity, DepartureDate, AvgFreeSeats, Expiredtrip,Visual_Avaiability, ID)" 
            TableName="GetLastInsertedTrips">
        </asp:LinqDataSource>
        <asp:ListView ID="ListViewLastTrips" runat="server" 
            DataSourceID="LDS_LastTrips">
        <LayoutTemplate> 
            <asp:PlaceHolder ID="itemPlaceholder" runat="server"></asp:PlaceHolder>
        </LayoutTemplate>
    
        <ItemTemplate>
            <div id="content_lastTripCreated">
            
                
          <asp:Image ID="igmUser" runat="server" ImageUrl='<%# "master/resourcesNew/img/trip_" + ""+Eval("Expiredtrip")+ "_expired.png" %>' />
               <span>
                <strong> <asp:Label ID="From" runat="server" Text="From:" meta:resourcekey="stats_trip_from"></asp:Label> </strong>
                <asp:HyperLink ID="LinkButtonLastTrips_01" 
                 NavigateUrl='<%# "passengerTripDetail.aspx?Trip=" +  Eval("ID") %>'
                runat="server" ><%# Eval("OriginCity")%></asp:HyperLink>
                <strong> <asp:Label ID="To" runat="server" Text="To:" meta:resourcekey="stats_trip_to"></asp:Label> </strong>
                 <asp:HyperLink ID="LinkButtonLastTrips_02" NavigateUrl='<%# "passengerTripDetail.aspx?Trip=" +  Eval("ID") %>' runat="server" ><%# Eval("DestinationCity")%></asp:HyperLink>
                 <strong> <asp:Label ID="Date" runat="server" Text="Date:" meta:resourcekey="stats_trip_Date"></asp:Label> </strong>
                  <asp:HyperLink ID="LinkButtonLastTrips_03" NavigateUrl='<%# "passengerTripDetail.aspx?Trip=" +  Eval("ID") %>' runat="server" ><%# Eval("DepartureDate")%></asp:HyperLink>
                 <div id="content_info_last_trip">
                 
                 <strong> <asp:Label ID="Availability" runat="server" Text="Availability:" meta:resourcekey="stats_trip_Avaiability"></asp:Label> </strong>
                 <asp:HyperLink ID="LinkButton2" NavigateUrl='<%# "passengerTripDetail.aspx?Trip=" +  Eval("ID") %>' runat="server" ><%# Eval("AvgFreeSeats")%>%</asp:HyperLink>
               
                 <asp:Image ID="Image4" ImageUrl='<%# "~/master/resourcesNew/img/img_disp/bar_" + ""+Eval("Visual_Avaiability")+ ".png" %>'  runat="server" />
                </div>
            </span>
            </div>
        </ItemTemplate>
        
        </asp:ListView>
        </div>
    </div>
    
    
    

        <div id="dss">
        <div id="content_description_info" >
                
                <div id="content_info_description">
                    <h3 id="chi_siamo">
                        <asp:Label ID="lblDefaultDescription" runat="server" Text="Chi Siamo" meta:resourcekey="default_chiSiamo"></asp:Label>
                    </h3>
                    <div id="description">
                    <asp:Label di="description" runat="server" meta:resourcekey="description" ></asp:Label>  
                    </div>
                </div>
                   
                
        </div>
        <div id="slogan">          
            <asp:Label ID="lbl_slogan" runat="server"  meta:resourcekey="default_slogan"></asp:Label>
                     <br />
            <div class="slogan_2">
             <asp:Label ID="lbl_slogan_co2" runat="server"  meta:resourcekey="default_slogan_co2"></asp:Label>
             <span id="count"> </span></div>
        </div>
    
    </div>
    
    </div>
    <div id="content_info_logo"></div>
    <div id="content_windows_footer"></div>
    </div>
    <div id="defaultContentLeft">
        
        
        <cc1:Accordion ID="Accordion1" runat="Server" SelectedIndex="1" HeaderCssClass="accordionHeader"
                    HeaderSelectedCssClass="accordionHeaderSelected" ContentCssClass="accordionContent"
                    AutoSize="None" FadeTransitions="true" TransitionDuration="250" FramesPerSecond="40"
                    RequireOpenedPane="false" SuppressHeaderPostbacks="true" Width="730px">
                    <Panes>
                        <cc1:AccordionPane ID="AccordionPane1" runat="Server">
                            <Header>
                               <div id="content_lbl_mobile">TripLoa Mobile
                               <div style=" font-size: 15px; color:White; padding-left:1%;">
                               <asp:Label ID="click_h" runat="server" meta:resourcekey="click_here"></asp:Label>
                               </div>
                               </div>
                               
                            </Header>
                            <Content>
                            <div id="content_description_mobile">
                                <asp:Label ID="mobile_description_p1" runat="server" meta:resourcekey="mobile_description_p1"></asp:Label><br />
                                <asp:Label ID="mobile_description_p2" runat="server" meta:resourcekey="mobile_description_p2"></asp:Label><br />
                                <br />
                                <asp:Label ID="mobile_description_p3" runat="server" meta:resourcekey="mobile_description_p3"></asp:Label><br />
                                <asp:Label ID="mobile_description_p4" runat="server" meta:resourcekey="mobile_description_p4"></asp:Label><br />
                                <br />
                                <asp:Label ID="mobile_description_p5" runat="server" meta:resourcekey="mobile_description_p5"></asp:Label><br />
                                <asp:Label ID="mobile_description_p6" runat="server" meta:resourcekey="mobile_description_p6"></asp:Label><br />
                                
                                <ul class="mobile">
                                    <li class="mobile"><asp:Label ID="mobile_description_li_1" runat="server" meta:resourcekey="mobile_description_li_1"></asp:Label></li>
                                    <li class="mobile"><asp:Label ID="mobile_description_li_2" runat="server" meta:resourcekey="mobile_description_li_2"></asp:Label></li>
                                    <li class="mobile"><asp:Label ID="mobile_description_li_3" runat="server" meta:resourcekey="mobile_description_li_3"></asp:Label></li>
                                    <li class="mobile"><asp:Label ID="mobile_description_li_4" runat="server" meta:resourcekey="mobile_description_li_4"></asp:Label></li>
                                    <li class="mobile"><asp:Label ID="mobile_description_li_5" runat="server" meta:resourcekey="mobile_description_li_5"></asp:Label></li>
                                    <li class="mobile"><asp:Label ID="mobile_description_li_6" runat="server" meta:resourcekey="mobile_description_li_6"></asp:Label></li>
                                    <li class="mobile"><asp:Label ID="mobile_description_li_7" runat="server" meta:resourcekey="mobile_description_li_7"></asp:Label></li>
                                </ul>
                                <br />
                                <asp:Label ID="mobile_description_p7" runat="server" meta:resourcekey="mobile_description_p7"></asp:Label><br />
                                <asp:Label ID="mobile_description_p8" runat="server" meta:resourcekey="mobile_description_p8"></asp:Label><br />
                                
                                <br />
                                <br />
                            <h2 class="mobile">Download TripLoa Mobile</h2>
                                <br />
                            </div>
                            
                            <div id="content_info_mobile">
                                <br />                    
                                
                                <div class="download_header"></div>   
                                <div class="download_content"> 
                                <asp:Label ID="windows_mobile" runat="server" CssClass="title_type_mobile">TripLoa Windows Mobile</asp:Label><br />
                                <asp:Label ID="Label2" runat="server" CssClass="lbl_strong" >Versione:</asp:Label>
                                <asp:Label ID="Label3" runat="server"> 1.0</asp:Label><br />
                                <asp:HyperLink ID="HyperLink1" NavigateUrl="~/m/TripLOAMobile_Installer.CAB" Text="Download" runat="server" CssClass="link_master"></asp:HyperLink><br />
                                </div> 
                                <div class="download_footer"></div> 
                                <br />
                                <div class="download_header"></div>   
                                <div class="download_content"> 
                                <asp:Label ID="Label4" runat="server" CssClass="title_type_mobile">TripLoa Java Mobile</asp:Label><br />
                                <asp:Label ID="Label5" runat="server" CssClass="lbl_strong" meta:resourcekey="lbl_version"></asp:Label>
                                <asp:Label ID="Label6" runat="server"> 1.0</asp:Label><br />
                                <asp:Label ID="v_it" runat="server" Text="Versione Italiana: " CssClass="label_title" meta:resourcekey="lbl_v_IT"></asp:Label>
                                <asp:HyperLink ID="download_jar_it" NavigateUrl="~/m/Generic-Midp2Cldc11Nodified-it_IT-blank.jar" Text="JAR" runat="server" CssClass="link_master"></asp:HyperLink> |
                                <asp:HyperLink ID="download_jad_it" NavigateUrl="~/m/Generic-Midp2Cldc11Nodified-it_IT-blank.jad" Text="JAD" runat="server" CssClass="link_master"></asp:HyperLink>
                                <br />
                                <asp:Label ID="v_en" runat="server" Text="Versione Inglese: " CssClass="label_title" meta:resourcekey="lbl_v_EN"></asp:Label>
                                <asp:HyperLink ID="download_jar_en" NavigateUrl="~/m/Generic-Midp2Cldc11Nodified-en_US-blank.jar" Text="JAR" runat="server" CssClass="link_master"></asp:HyperLink> |
                                <asp:HyperLink ID="download_jad_en" NavigateUrl="~/m/Generic-Midp2Cldc11Nodified-en_US-blank.jad" Text="JAD" runat="server" CssClass="link_master"></asp:HyperLink>
                                </div> 
                                <div class="download_footer"></div> 
                            </div>
                           
                            </Content>
                            
                        </cc1:AccordionPane>
                          </Panes>
                </cc1:Accordion>
    
    

</div>
    <script type="text/javascript">
        prova();
    </script>
</asp:Content>
